// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_HR_EMPLOYEE
// * CreateDate    : 2011/10/27 13:18:50
// * Creater       : CodeSmith
// * LastChangeDate: 2011/10/27 13:18:50
// * LastChanger   : 2011/10/27 13:18:50
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Hr
{
/// <summary>
    /// HrEmployee
    /// </summary>
    public partial class HrEmployeeBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objHrEmployeeEntity">Entity</param>
        /// <returns>Entity</returns>
        public static HrEmployeeEntity GetHrEmployee(HrEmployeeEntity objHrEmployeeEntity)
        {
            return DataAccess.SelectSingle<HrEmployeeEntity>(objHrEmployeeEntity);
        }
        public static HrEmployeeEntity GetHrEmployeeByPersonId(string personId)
        {
            if (string.IsNullOrEmpty(personId))
            {
                return null; ;
            }
            HrEmployeeEntity entity = new HrEmployeeEntity();
            entity.PersonId = personId;
            return DataAccess.SelectSingle<HrEmployeeEntity>(entity);
        }
        public static MstPersonEntity GetMstPersonByID(string personId)
        {
            if (string.IsNullOrEmpty(personId))
            {
                return null;
            }
            MstPersonEntity objMstPersonEntity = new MstPersonEntity();
            objMstPersonEntity.PersonId = personId;
            return DataAccess.SelectSingle<MstPersonEntity>(objMstPersonEntity);
        }
        #endregion

        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objHrEmployeeEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertHrEmployee(HrEmployeeEntity objHrEmployeeEntity)
        {
            return DataAccess.Insert(objHrEmployeeEntity);
        }

        public static bool InsertHrEmployee(List<HrEmployeeEntity> objHrEmployeeEntityList)
        {
            return DataAccess.Insert(objHrEmployeeEntityList);
        }
        #endregion

        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objHrEmployeeEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateHrEmployee(HrEmployeeEntity objHrEmployeeEntity)
        {
            return DataAccess.Update(objHrEmployeeEntity);
        }

        public static bool UpdateHrEmployee(List<HrEmployeeEntity> objHrEmployeeEntityList)
        {
            return DataAccess.Update<HrEmployeeEntity>(objHrEmployeeEntityList);
        }
        #endregion

        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objHrEmployeeEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteHrEmployee(HrEmployeeEntity objHrEmployeeEntity)
        {
            return DataAccess.Delete(objHrEmployeeEntity);
        }

        public static bool DeleteHrEmployee(List<HrEmployeeEntity> objHrEmployeeEntityList)
        {
            return DataAccess.Delete<HrEmployeeEntity>(objHrEmployeeEntityList);
        }
        #endregion

        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetHrEmployeeAll()
        {
            return DataAccess.SelectAllDataSet<HrEmployeeEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<HrEmployeeEntity> GetHrEmployeeAllList()
        {
            return DataAccess.SelectAll<HrEmployeeEntity>();
        }
        #endregion
	}
	
	
}	

